/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';
const { mock } = Mock;

export default {
  'POST /Inn/leagueFeeApplyLog': (req: Request, res: Response) => {
    res.send(
      mock({
        code: '0',
        msg: 'success',
        data: {
          'total|50-100': 50,
          'list|20': [
            {
              id: '@id',
              league_id: '@id',
              fee_type: '1',
              original_fee: '0.01',
              apply_fee: '0.00',
              check_status: '1',
              check_reason: '',
              create_at: '@datetime',
              operate_at: '@datetime',
              'op_status|1': ['1', '0'],
              league_name: '@cname',
              contact_name: '@cname',
              service_share_ratio: '0',
              'check_status_desc|1': ['通过', '拒绝'],
            },
          ],
        },
      }),
    );
  },
  'POST /Inn/leagueApplyCheck': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/getLeaguePostData': (req: Request, res: Response) => {
    res.send(
      mock({
        code: '0',
        msg: 'success',
        data: {
          'total|50-100': 50,
          'list|20': [
            {
              id: '@id',
              cm_id: '@id',
              brand: '申通,中通,韵达',
              name: '@cname',
              phone: /1[3-9]\d{9}$/,
              delivery_num: '1000-3000票',
              'picture_path|1': ['', '//img.kuaidihelp.com/xyt/qrcode.png'],
              location: '辽宁省-沈阳市-铁西区',
              province: '辽宁省',
              city: '沈阳市',
              district: '铁西区',
              create_time: '@datetime',
              wx_nick: '@cname',
              openid: '',
              source: '0',
              league_id: '0',
              'status|1': ['0', '1'],
              status_str: '未处理',
              agency_league: '',
            },
          ],
        },
      }),
    );
  },
  'POST /Inn/getLeaguePostDataById': (req: Request, res: Response) => {
    res.send(
      mock({
        code: '0',
        msg: 'success',
        data: {
          phone: /1[3-9]\d{9}$/,
        },
      }),
    );
  },

  'POST /Inn/pushToLeague': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/downloadLeaguePostData': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/addRegionAdmin': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/indexJson': (req: Request, res: Response) => {
    res.send(
      mock({
        code: '0',
        msg: 'success',
        data: {
          'total|50-100': 50,
          'result|20': [
            {
              id: '@id',
              company_name: '@cname',
              valid_date: '@datetime',
              concat_name: '@cname',
              phone: /1[3-9]\d{9}$/,
              contact_phone: /1[3-9]\d{9}$/,
              service_fee: '7.00',
              service_share_ratio: '23',
              address: '@county(true)',
              'agency_area|0-2': [
                {
                  province: '@province',
                  city: '@city',
                  district: ['长宁区'],
                },
              ],
              'is_special|1': ['0', '1'],
              'is_complate|1': ['0', '1'],
              'is_sitescan|1': ['0', '1'],
              complate_fee: '7.00',
            },
          ],
        },
      }),
    );
  },

  'POST /Inn/indexDetail': (req: Request, res: Response) => {
    res.send(
      mock({
        code: 0,
        msg: '成功',
        data: {
          id: '1243417',
          company_name: '新零售加盟商测试dxx',
          start_date: '2021-08-16',
          end_date: '2027-11-06',
          concat_name: '新零售加盟商',
          phone: '18721008363',
          contact_phone: '18721008363',
          province: '上海市',
          city: '上海市',
          district: '徐汇区',
          town: '斜土路街道',
          province_code: '310000000000',
          city_code: '310100000000',
          district_code: '310104000000',
          town_code: '310104007000',
          address: '建滔广场',
          agency_area: [
            {
              id: '1283',
              league_id: '1243417',
              province: '上海市',
              city: '上海市',
              district: '静安区',
              town: '静安寺街道',
              province_code: '310000000000',
              city_code: '310100000000',
              district_code: '310106000000',
              town_code: '310106013000',
            },
            {
              id: '1284',
              league_id: '1243417',
              province: '上海市',
              city: '上海市',
              district: '静安区',
              town: '曹家渡街道',
              province_code: '310000000000',
              city_code: '310100000000',
              district_code: '310106000000',
              town_code: '310106014000',
            },
          ],
          is_need_check: '0',
          service_share_ratio: '0',
          service_fee: 0,
          is_special: '1',
          'is_complate|1': ['0', '1'],
          'complate_edit|1': ['0', '1'],
          complate_fee: '7.00',
        },
      }),
    );
  },
};
